Due 1/26 by the start of class.
Read/scan through the 2019 Stepping Stones report to get a feel for the selected metrics, their organization, documentation, and justifications or explanations.
Submit your brief (e.g., one or two paragraph) responses to the Stepping Stones slack channel.
Download this zipped file and save the (unzipped) folder (learningR) where you can find it on your computer. Within the folder there is
Start an R/Rstudio session by double-clicking on learnignR.Rproj. Start a new .R script (New File –> R Script) that does the following:
read_csv()
),
giving each a relevant name. How many variables and observations does
each file have? (Provide answers in comments within the script.)str()
or
glimpse()
). Do the variables have the same type (e.g.,
characters, numbers, logicals, etc.) across all three data sets?View()
or click on the name of the data frame in the Global
Environment pane). Pick any variable you like and sort the data by that
variable - in what year is that variable the highest? The lowest? Answer
the same question (for the samer variable) for the Albemarle file.dplyr
functions filter()
and
select()
, along with the pipe command %>%
,
write a command that starts with the Charlottesville data frame, filters
for the year 2016, and selects the variable voter_reg (percent of
voting-age-population that is registered to vote). What percent of
Charlotteville residents were registered in 2016? Repeat the command for
the Albemarle data frame – what percent of Albemarle residents were
registered in 2016?Save the script into the scripts folder. When complete, submit this
file to me via direct message on slack (give it a name like
week1_mpc.R
as I’ll be adding everyone’s to the same script
folder in my own version of this folder!)